home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
oper_sys
/
oasis
/
oasisegs.lha
/
egs
/
hanoi.pl
< prev
next >
Wrap
Text File
|
1992-03-25
|
175b
|
10 lines
/* Prolog version of hanoi benchmark */
main :- han(20,1,2,3).
han(N,_,_,_) :- N=<0.
han(N,A,B,C) :- N>0,
N1 is N - 1,
han(N1,A,C,B),
han(N1,C,B,A).